package org.langcom.state;

import org.langcom.logic.ILogic;


public abstract class AbstractTransition implements IStateTransition {

	private IState fromState;
	private IState toState;
	private ILogic logic;

	public AbstractTransition(IState fromState, IState toState, ILogic logic) {
		this.fromState = fromState;
		this.toState = toState;
		this.logic = logic;
	}

	public boolean checkState() {
		return logic.check();
	}

	public IState getFromState() {
		return fromState;
	}

	public IState getToState() {
		return toState;
	}

	public ILogic getTransitionLogic() {
		return logic;
	}

	public void setFromState(IState state) {
		this.fromState = state;
	}

	public void setToState(IState state) {
		this.toState = state;
	}

	public void setTransitionLogic(ILogic logic) {
		this.logic = logic;
	}
	
}


